home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_5.lha / 5_5 / 5_5d2.c < prev    next >
Text File  |  1993-08-08  |  330b  |  19 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. nt expr::eval()
  6.  
  7.    if (!evaluated)
  8. {
  9. istream input(strlen(s), s);
  10. get_token(input);
  11. tree *head = expandtree(input);
  12. value = treeval(head);
  13. delete head;
  14. evaluated++;
  15. }
  16.  
  17.    return value;
  18.  
  19.